home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 21
/
Cream of the Crop 21 (Terry Blount) (October 1996).iso
/
program
/
libkb100.zip
/
LIBKB-1.00
/
UTIL
/
HARDWARE.DOC
< prev
next >
Wrap
Text File
|
1996-07-23
|
3KB
|
63 lines
news:rec.games.programmer
Subject: Re: more keyboard handler woes...
From: gordon@sneaky.lonestar.org (Gordon Burditt)
> > Those are natural limitations of the "matrix" method that
> > keyboard are built using. There are *NOT* one single wire
> > for each key - but instead the keyboard uses a grid of wires
> > so that when a key is pressed a connection wil be formed
> > between a row and a column. Therefore if you press several
> > keys simultaneously - another connection might be perceived
> > by the keyboard controller!
> Yes, but the keyboard controller CPU is supposed to be smart enough to
> identify the keys as they are pressed and subtract their effects from
> future key manipulations.
> Are they incapable of performing N key rollover?
Each key is connected to two wires, shown as horizontal and vertical
below. When the key is pressed, it connects these two wires.
The keyboard controller sends out a signal on one of the horizontal
wires and observes which of the vertical wires have the signal appear.
Then it tries the next wire, and so on. From this, it can determine
which keys are pressed. Usually. You won't have a problem if
no more than 3 keys are down at once.
-------A-------B-------C-------D-------E--------F
| | | | | |
-------G-------H-------I-------J-------K--------L
| | | | | |
-------M-------N-------O-------P-------Q--------R
| | | | | |
-------S-------T-------U-------W-------X--------Y
| | | | | |
Suppose keys A, B, and S are pressed. If the keyboard CPU sends
out a signal on the horizontal wire connected to S, it gets back
signals on the vertical wires connected to both S and T. Why T?
Because there's a sneak path through keys S, A, and B that makes
it look like T is pressed also. The CPU can't actually tell
whether T is pressed, as there is no difference in the signals.
You get this problem every time 3 keys in a rectangle are
pressed. The keyboard CPU may suppress the phantom make code
for T, but it can't detect real makes and breaks for it.
(I suppose they could design keyboards with a diode at each key
to prevent this, but that costs extra money. The current is going
backwards through A in the above example, and a diode would block
that.)
Now consider what happens if keys A, B, C, D, E, F, K, Q, and X
are pressed. Every time ANY signal is sent out on a horizontal
wire, it comes back on all of the vertical wires. You can't
tell whether any of the other keys are pressed, so the
keyboard won't respond to any of them.
It is also possible to design keyboards so that the keys in
rectangles are all unlikely to be used together. It takes a
lot of good guessing to determine what those will be for
next year's games.
Gordon L. Burditt
sneaky.lonestar.org!gordon